<form [formGroup]="networkForm">
<div class="col-6 center-of-all" *ngIf="progress.isCompleted">
<div class="card" >

  <div class="card-header font-weight-bold p-2">
    <span class="fa fa-fw fa-info-circle"></span>网络配置
  </div>
  <div class="card-body p-1">
    <div  class="col-6 center-of-all mt-2">
      <label *ngFor="let net of networkInfo; let index = index" class="col-6 text-center" (click)="changeCurrentType(index)">
        <input class="text-center" name="Type" type="radio" value="" />{{net.name }}-{{net.status}}</label>
    </div>
    <div class="col-6 center-of-all mt-2">
      <button class="btn btn-sm text-center ml-5" (click)="changeNetworkStauts(1)">启动</button>
      <button class="btn btn-sm text-center ml-5" (click)="changeNetworkStauts(2)">禁用</button>
    </div>

    <div class="card ml-3 mr-3 mt-3" *ngIf="currentStatus !== undefined && currentStatus === 1">
      <div class="card-header font-weight-bold p-2">
        <span class="fa fa-fw fa-info-circle"></span>网络信息
      </div>
      <div class="card-body p-1">
        <div class="col-6 center-of-all mt-2">
          <label class="col-6 text-center" (click)="changeCurrentMold(1)"><input class="text-center" name="Mold" type="radio" value="" />DHCP </label>
          <label class="col-6 text-center" (click)="changeCurrentMold(2)"><input class="text-center" name="Mold" type="radio" value="" />静态IP </label>
        </div>

        <div>
          <div class="form-group row">
            <label class="col-3 col-form-label text-right">IP地址</label>
            <div class="col-7">
              <input *ngIf="currentMold === 1" disabled="disabled" type="text" formControlName="addr" class="form-control form-control-sm" >
              <input *ngIf="currentMold === 2" type="text" formControlName="addr" class="form-control form-control-sm" >
            </div>
          </div>

          <div class="form-group row">
            <label class="col-3 col-form-label text-right">网关</label>
            <div class="col-7">
              <input *ngIf="currentMold === 1" disabled="disabled"  type="text" formControlName="gateway" class="form-control form-control-sm" >
              <input *ngIf="currentMold === 2" type="text" formControlName="gateway" class="form-control form-control-sm" >
            </div>
          </div>
          <div class="form-group row">
            <label class="col-3 col-form-label text-right">子网掩码</label>
            <div class="col-7">
              <input *ngIf="currentMold === 1" disabled="disabled"  type="text" formControlName="netmask" class="form-control form-control-sm">
              <input *ngIf="currentMold === 2" type="text" formControlName="netmask" class="form-control form-control-sm">
            </div>
          </div>
          <div class="form-group row">
            <label class="col-3 col-form-label text-right">DNS</label>
            <div class="col-7">
              <input *ngIf="currentMold === 1" disabled="disabled"  type="text" formControlName="dns" class="form-control form-control-sm">
              <input *ngIf="currentMold === 2" type="text" formControlName="dns" class="form-control form-control-sm">
            </div>
          </div>
        </div>

      </div>
    </div>

    <div class="row mt-2 mb-2">
      <div class="col-10 offset-1 text-center">
        <button type="button" class="btn btn-sm btn-teal w-50"
                (click)="setNetworkInfo()">确定
        </button>
      </div>
    </div>
  </div>
</div>
</div>
</form>
<ng-tools-loading [loading]="loadingOptions"></ng-tools-loading>
